package com.gagakuai.bpm.domian.events;


import com.gagakuai.bpm.busniess.run.CallBusinessStartProcessRun;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class CallBusinessStartProcessListener implements ApplicationListener<CallBusinessStartProcessEvent> {

    @Resource
    private CallBusinessStartProcessRun callBusinessStartProcessRun;

    @Override
    public void onApplicationEvent(@NonNull CallBusinessStartProcessEvent event) {
        callBusinessStartProcessRun.setEvent(event);
        callBusinessStartProcessRun.run();
    }
}
